<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<link rel="stylesheet" href="css/amazeui.min.css" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/css/amazeui.min.css" type="text/css" />
		<link rel="stylesheet" href="css/style.css" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/css/style.css" type="text/css" />
	</head>

	<body>
		<!--<header data-am-widget="header" class="am-header am-header-default jz">
			<div class="am-header-left am-header-nav">
				<i class="am-icon-calendar"  style="color: gray;font-size: 26px;"></i>
			</div>
			<h1 class="am-header-title">
		          <a href="#title-link" class="">瑞蓝报价</a>
		      </h1>
		</header>-->
		<div style="background-image: url(img/bg.png);height: 100px;" class="am-slider am-slider-default"> 
			<div style="width: 45%;float: left;margin-left: 3%;height: 100px;">
				<p style="padding-top: 30px;color: #fff;margin-bottom: -20px;padding-left: 25px;" id="xq">星期三</p>
				<p>
					<span style="color: #fff;padding-left: 10px;" id="ny">2018年3月</span>
					<span style="font-size: 28px;color: #fff;" id="ri">14号</span>
				</p>
			</div>
			<div style="width: 45%;float: left;margin-left: 5%;height: 100px;">
				<div>
					<input id="testView" type="hidden" onchange="changeTimes(this.value);" />
					<i class="am-icon-calendar am-icon-lg" id="test28"  style="position:absolute;color: #fff;padding-left: 40%;padding-top: 40px;right: 25%;font-size: 10px;"></i>
					<i class="am-icon-repeat am-icon-spin" id="ref"  style="position:absolute;color: #fff;font-size: 26px;right: 10%;top: 30%;"></i>
				</div>
			</div>
	        <!--<ul class="am-slides">  
	            <li><img src="images/banner.png"></li>  
	            <li><img src="images/banner1.png"></li>  
	        </ul>  -->
		</div>
		<div class="reg2">
			<div style="margin-bottom: 10px;">
				<span class="am-icon-bar-chart am-icon-sm" style="color: #fe3360;"></span>
				<span style="font-family: '微软雅黑';font-weight: 800;padding-left:10px">实时房源动态</span>
			</div>
			<a >
				<div class="brand-left" style="width: 33%;text-align: center;background-color: #FFFFFF;">
					<h2 style="color: #fc4100;font-size: 26px;" id="kc">0</h2>
					<p >&nbsp;&nbsp;</p>
					<p style="margin-top: -20px;text-align: center;color: #666;">库存房量</p>
					<p style="color: #666;font-size: 10px;" class="yue">2018-03-12</p>
				</div>
			</a>
			<a>
				<div class="brand-left" style="width: 33%;text-align: center;background-color: #FFFFFF;">
					<h2 style="color: #fc4100;font-size: 26px;" id="jj">0</h2>
					<p >&nbsp;&nbsp;</p>
					<p style="margin-top: -20px;text-align: center;color: #666;">平均房价</p>
					<p style="color: #666;font-size: 10px;" class="yue">2018-03-12</p>
				</div>
			</a>
			<a >
				<div class="brand-left" style="width: 33%;text-align: center;background-color: #FFFFFF;">
					<h2 style="color: #fc4100;font-size: 26px;" id="sj">0</h2>
					<p >&nbsp;&nbsp;</p>
					<p style="margin-top: -20px;text-align: center;color: #666;">报价商家</p>
					<p style="color: #666;font-size: 10px;" class="yue">2018-03-12</p>
				</div>
			</a>
			<div style="height: 80px;"></div>
		</div>
		<div style="margin-left: 15px;margin-top: 20px;" class="doc-example">
			<span class="am-icon-calculator am-icon-sm" style="color: #fe3360;"></span>
			<span style="font-family: '微软雅黑';font-weight: 800;padding-left:10px">实时房型报价</span>
		</div>
		<ul class="brand" style="border: none;" id="hotelInfos">
			<!--<li>
				<a href="about.html" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/about.html">
					<div class="brand-left">
						<i class="am-icon-home am-icon-sm"></i>
						<div class="text">
							<h2 style="color: #009CDA;">特价大床房</h2>
							<p >库存&nbsp;&nbsp;25间</p>
							<p style="color: #BE590A;">均价&nbsp;&nbsp;￥25</p>
							<p style="color: #009CDA;">报价商家数&nbsp;&nbsp;25家</p>
						</div>
					</div>
				</a>
			</li>
			-->
		</ul>
		<div class="doc-example">
			<div style="margin-left: 15px;margin-top: 20px;">
				<span class="am-icon-spinner am-icon-sm" style="color: #fe3360;"></span>
				<span style="font-family: '微软雅黑';font-weight: 800;padding-left:10px">业主圈</span>
			</div>
			<ul class="am-comments-list am-comments-list-flip" id="lists">
				<!--<li class="am-comment">
					<a href="#link-to-user-home"><img src="http://www.gravatar.com/avatar/1ecedeede84a44f371b9d8d656bb4265?d=mm&amp;s=96" alt="" class="am-comment-avatar" width="48" height="48"></a>
					<div class="am-comment-main">
						<header class="am-comment-hd">
							<div class="am-comment-meta">
								<a href="#link-to-user" class="am-comment-author">路人甲</a> 说 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-13 0:03</time></div>
						</header>
						<div class="am-comment-bd">
							<p>She's gone 我早知道<br>她将要 从我的生命中走掉<br>不再停留多一秒</p>
						</div>
					</div>
				</li>
				<li class="am-comment">
					<a href="#link-to-user-home"><img src="http://www.gravatar.com/avatar/1ecedeede84a44f371b9d8d656bb4265?d=mm&amp;s=96" alt="" class="am-comment-avatar" width="48" height="48"></a>
					<div class="am-comment-main">
						<header class="am-comment-hd">
							<div class="am-comment-meta">
								<a href="#link-to-user" class="am-comment-author">路人甲</a> 说 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-13 0:03</time></div>
						</header>
						<div class="am-comment-bd">
							<p>She's gone 我早知道<br>她将要 从我的生命中走掉<br>不再停留多一秒</p>
						</div>
					</div>
				</li>
				<li class="am-comment">
					<a href="#link-to-user-home"><img src="http://www.gravatar.com/avatar/1ecedeede84a44f371b9d8d656bb4265?d=mm&amp;s=96" alt="" class="am-comment-avatar" width="48" height="48"></a>
					<div class="am-comment-main">
						<header class="am-comment-hd">
							<div class="am-comment-meta">
								<a href="#link-to-user" class="am-comment-author">路人甲</a> 说 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-13 0:03</time></div>
						</header>
						<div class="am-comment-bd">
							<p>She's gone 我早知道<br>她将要 从我的生命中走掉<br>不再停留多一秒</p>
						</div>
					</div>
				</li>
				<li class="am-comment">
					<a href="#link-to-user-home"><img src="http://www.gravatar.com/avatar/1ecedeede84a44f371b9d8d656bb4265?d=mm&amp;s=96" alt="" class="am-comment-avatar" width="48" height="48"></a>
					<div class="am-comment-main">
						<header class="am-comment-hd">
							<div class="am-comment-meta">
								<a href="#link-to-user" class="am-comment-author">路人甲</a> 说 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-13 0:03</time></div>
						</header>
						<div class="am-comment-bd">
							<p>She's gone 我早知道<br>她将要 从我的生命中走掉<br>不再停留多一秒</p>
						</div>
					</div>
				</li>-->
			</ul>
		</div>
		<div style="height: 55px;"></div>
		<div data-am-widget="navbar" class="am-navbar  gm-foot am-no-layout" id="">
			<ul class="am-navbar-nav am-cf am-avg-sm-4">
				<li class="curr">
					<a href="index.html"  class="curr">
						<span class="am-icon-home"></span>
						<span class="am-navbar-label">首页</span>
					</a>
				</li>
				<li>
					<a href="price.html" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/order.html" class="">
						<span class="am-icon-paypal"></span>
						<span class="am-navbar-label">报价</span>
					</a>
				</li>
				<li>
					<a href="yezhuquan.html" class="">
						<span class="am-icon-spinner"></span>
						<span class="am-navbar-label">业主圈</span>
					</a>
				</li>
				<li>
					<a href="main.html" class="">
						<span class="am-icon-user"></span>
						<span class="am-navbar-label">我的</span>
					</a>
				</li>
			</ul>
		</div>
	</body>
<script type="text/javascript" src="js/jquery.min.js" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/js/jquery.min.js"></script>
<script type="text/javascript" src="js/amazeui.min.js" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/js/amazeui.min.js"></script>
<script type="text/javascript" src="js/hui.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>
<!--<script>
    $(function(){  
        $('.am-slider').flexslider({  
            playAfterPaused: 3000,  
            animation: "fade",  
            animationLoop: true,  
            smoothHeight: true,  
            animationSpeed: 4000  
        });  
    });   
</script>  -->
<script>
	var id = localStorage.getItem("id");
	if(!id){
		location.href="login.html";
	}else{
		hui.getJSON(
			rootpath + '/businessMan/findBusinessMan/' + id,
			function(msg) {
				console.log(msg);
				if(msg.isActive!=0){
					hui.toast('你已被管理员禁用，将无权限访问!', 'warn');
					localStorage.removeItem("id")
					location.href="login.html";
					return;
				}
			},
			function(e) {
				hui.iconToast('读取消息失败', 'warn');
				console.log(e);
			}
		);
	}
	var show_day=new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六'); 
	var time=new Date(); 
	var year=time.getFullYear(); 
	var month=time.getMonth()+1; 
	var date=time.getDate(); 
	var day=time.getDay(); 
	var hour=time.getHours(); 
	var minutes=time.getMinutes(); 
	var second=time.getSeconds(); 
	$("#xq").html(show_day[day]);
	$("#ny").html(year+'年'+month+'月');
	$("#ri").html(date+"号");
  	$(".yue").html(year+"-"+(parseInt(month)<10?"0"+month:month)+"-"+(parseInt(date)<10?"0"+date:date));
	timesInfo(year+"-"+(parseInt(month)<10?"0"+month:month)+"-"+(parseInt(date)<10?"0"+date:date));
    laydate.render({
	    elem: '#test28'
      	,showBottom: false
		,done: function(value, date){
			document.getElementById("testView").value=value;
			changeTimes(value);
	    }
    });
	function getTimes(){
		$("#test28").click();
	}
	function times(){
		alert("afsasfs");
	}
	function a(){
	    $("#test28").html("");
	}
	setInterval(a,1);
	function changeTimes(val){
		var show_day=new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六'); 
		var time=new Date(val); 
		var year=time.getFullYear(); 
		var month=time.getMonth()+1; 
		var date=time.getDate(); 
		var day=time.getDay(); 
		var hour=time.getHours(); 
		var minutes=time.getMinutes(); 
		var second=time.getSeconds(); 
		$("#xq").html(show_day[day]);
		$("#ny").html(year+'年'+month+'月');
		$("#ri").html(date+"号");
		$(".yue").html(year+"-"+(parseInt(month)<10?"0"+month:month)+"-"+(parseInt(date)<10?"0"+date:date));
		timesInfo(year+"-"+(parseInt(month)<10?"0"+month:month)+"-"+(parseInt(date)<10?"0"+date:date));
	}
	hui.postJSON(
	    rootpath+'/char/charList/',
	    {
	    	pageSize:50,
	    	pageIndex: 1,
	    	searchVal:""
	    },
	    function(msg){
	    	var html = '<li class="am-comment" style="width:97%">';
	    	var all = "";
			html = html +'<a onclick="lookInfo(~);"><img src="~" alt="" class="am-comment-avatar" width="48" height="48"></a>';
			html = html +'<div class="am-comment-main">';
			html = html +'<header class="am-comment-hd">';
			html = html +'<div class="am-comment-meta">';
			html = html +'<a class="am-comment-author">~</a>  <time style="float:right">~</time></div>';
			html = html +'</header>';
			html = html +'<div class="am-comment-bd">';
			html = html +'<p>~</p>';
			html = html +'</div>';
			html = html +'</div>';
			html = html +'</li>';
	    	if(msg.total==0){
	    		$("#lists").html('<li><h4 align="center" style="margin-top:20px;">暂无数据</h4></li>');
	    	}else{
	    		for(var i=0;i<msg.rows.length;i++){
              	if(msg.rows[i].businessManVo.faceImg.indexOf("http")>-1){
                		all = all + html.replace("~",msg.rows[i].businessManId).replace("~",msg.rows[i].businessManVo.faceImg).replace("~",msg.rows[i].businessManVo.hotelSinName).replace("~",getDates(msg.rows[i].createTime)).replace("~",msg.rows[i].content);
                }else{
    					all = all + html.replace("~",msg.rows[i].businessManId).replace("~",rootpath+"/"+msg.rows[i].businessManVo.faceImg).replace("~",msg.rows[i].businessManVo.hotelSinName).replace("~",getDates(msg.rows[i].createTime)).replace("~",msg.rows[i].content);
                }

	    		}
	    		$("#lists").html(all);
	    	}
	    	
	    },
	    function(e){
	        hui.iconToast('读取消息失败', 'warn');
	        console.log(e);
	    }
	);
	function timesInfo(val){
		hui.postJSON(
		    rootpath+'/priceItem/priceItemInfo',
		    {
		    	times:val
		    },
		    function(msg){
				var htmls = '<li>';
				htmls = htmls + '<a onclick="hotelTypeInfo(~);">';
				htmls = htmls + '<div class="brand-left" style="width: 40%;">';
				htmls = htmls + '<h2 style="margin-top: 10px;color: #009cff;text-align:center">~</h2>';
				htmls = htmls + '</div>';
				htmls = htmls + '<div class="brand-left" style="padding-top: 10px;width: 27%;">';
				htmls = htmls + '<p style="color: #a6a6a6;text-align:center">库存 ~间</p>';
				htmls = htmls + '<p style="color: #a6a6a6;text-align:center">报价商家 ~家</p>';
				htmls = htmls + '</div>';
				htmls = htmls + '<div class="brand-left" style="padding-top: 7px;width: 33%;">';
				htmls = htmls + '<h1 style="padding-top: 10px;color: #b90000;text-align:center" >￥~</h1>';
				htmls = htmls + '</div>';
				htmls = htmls + '</a>';
				htmls = htmls + '</li><li style="border-bottom: solid 1px #ededed;width: 100%;height:62px">&nbsp;</li>';
				var $info = "";
		    	$("#kc").html(msg[0].sumHotel);
		    	$("#jj").html(Math.round(msg[0].sumPrice));
		    	$("#sj").html(msg[0].countBusincess);
		    	if(parseInt(msg[1].length)==0){
		    		$("#hotelInfos").html('<li><h4 align="center" style="margin-top:20px;margin-bottom:20px">暂无报价数据</h4></li>');
		    	}else{
		    		for(var i=0;i<msg[1].length;i++){
						$info = $info + htmls.replace("~",msg[1][i].hotelTypeId).replace("~",msg[1][i].hotelName).replace("~",msg[1][i].sumHotels).replace("~",msg[1][i].countBusincesss).replace("~",Math.round(msg[1][i].sumPrices));
					}
					$("#hotelInfos").html($info);
		    	}
				
		    },
		    function(e){
		        hui.iconToast('读取消息失败', 'warn');
		        console.log(e);
		    }
		);
	}
  $("#ref").click(function(){
		location.reload();
  });
  function hotelTypeInfo(id){
  	localStorage.removeItem("typeId");
  	localStorage.setItem("typeId",id);
  	location.href="info.html";
  }
  function lookInfo(val){
    localStorage.removeItem("busid");
    localStorage.setItem("busid",val);
    location.href="businessMan.html";

  }
</script>
</html>